package com.sjb.sixteen_journey_backend.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sjb.sixteen_journey_backend.entity.vo.UserBaseMsgVo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 评论信息列表
 * </p>
 *
 * @author jcz
 * @since 2024-07-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("message")
public class Message implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 评论信息列表id
     */
    @TableId(value = "message_id", type = IdType.AUTO)
    private Integer messageId;

    /**
     * 评论列表id
     */
    @TableField("comment_id")
    private Integer commentId;

    /**
     * 用户id
     */
    @TableField("user_id")
    @JsonIgnore
    private Integer userId;

    @TableField(exist = false)
    private UserBaseMsgVo user;

    /**
     * 回复人id
     */
    @TableField("target_id")
    @JsonIgnore
    private Integer targetId;

    @TableField(exist = false)
    private UserBaseMsgVo targetUser;

//    /**
//     * 评论时间
//     */
    @TableField("postdate")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime postdate;

    /**
     * 是否已读,默认为未读（0）
     */
    @TableField("is_Looked")
    private Boolean isLooked;


}
